<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<base href="<%=basePath%>" />
<title>soda教育</title>
<link href="qiantai/css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="qiantai/js/banner1.js"></script>
<link href="qiantai/css/single.css" type="text/css" rel="stylesheet" />

<script type="text/javascript">
	function ckbuy() {
		var als = document.getElementsByName("duoxuanName");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == true) {

				return true;
			}
		}
		alert("您还没有选您想结算的课程,请选择！");
		return false;
	}

	function ckjiesuan() {
		var als = document.getElementsByName("duoxuanName");
		var Array = [];
		if (ckbuy()) {
			for (var i = 0; i < als.length; i++) {
				if (als[i].checked) {
					Array.push(als[i].value);
				}
			}
			location.href = "ShowQianTaiServletYu?meet=jiesuan&Array=" + Array;
		}
	}
</script>

<script type="text/javascript">
	function clall(Obj) {
		//获取全选，全不选的所有复选框
		var cll = document.getElementsByName("duoxuanName");
		//如果Obj被选中那么全选	
		for (var i = 0; i < cll.length; i++) {
			cll[i].checked = Obj.checked;
		}
	}

	function claii() {
		var al = document.getElementById("all");
		var als = document.getElementsByName("duoxuanName");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == false) {
				al.checked = false;
			}
		}

	}

	function ckbuy() {
		var als = document.getElementsByName("duoxuanName");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == true) {

				return true;
			}
		}
		alert("您还没有选您想购买的视频，请选择！");
		return false;
	}

	function ckxuan() {
		var als = document.getElementsByName("duoxuanName");
		var Array = [];
		if (ckbuy()) {
			for (var i = 0; i < als.length; i++) {
				if (als[i].checked) {
					Array.push(als[i].value);
				}
			}
			location.href = "ShowQianTaiServletYu?meet=goumai&Array=" + Array;
		}
	}
	function ckqu() {
		var als = document.getElementsByName("duoxuanName");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == true) {

				return true;
			}
		}
		alert("请选择您想取消的视频！");
		return false;
	}
	function ckquxiao() {
		var als = document.getElementsByName("duoxuanName");
		var Array = [];
		if (ckqu()) {
			for (var i = 0; i < als.length; i++) {
				if (als[i].checked) {
					Array.push(als[i].value);
				}
			}
			if (confirm('请确认是否取消？'))
				location.href = "ShowQianTaiServletYu?meet=quxiao&Array="
						+ Array;
		}
	}
</script>

</head>

<body>
	<iframe style="width:100%;height:236px" scrolling="no" frameborder="0"
		src="qiantai/header.jsp"></iframe>
	<div class="content">

		<div class="clear"></div>
		<div class="buyDiv">

			<div class="buyHeader">
				<h1>课程结算</h1>
				<div class="innerDiv" onclick="history.back();">返 回</div>
				<div class="innerDiv" onclick="ckjiesuan();" id="jiesuan">结 算</div>
				<div class="innerDiv" onclick="ckquxiao();">取 消</div>
			</div>

			<div class="buyBody">
				<table class="buyTable" cellpadding="0" cellspacing="0">

					<tr>
						<th><input type="checkbox" id="all" name="dd"
							onclick="clall(this);" /></th>
						<th>课程名称</th>
						<th>课程讲师</th>
						<th>课程类型</th>
						<th>课程价格</th>
						<th>课程简介</th>
					</tr>
					<c:forEach items="${course}" var="cou">
						<tr>
							<td><input type="checkbox" id="ai" name="duoxuanName"
								value="${cou.couId }" onclick="claii();" /></td>
							<td>${cou.couName}</td>
							<td>${cou.user.useName}</td>
							<c:if test="${cou.couType==1 }">
								<td>现场授课</td>
							</c:if>
							<c:if test="${cou.couType==0 }">
								<td>在线视频</td>
							</c:if>
							<td>${cou.couMoney }</td>
							<td><p>${cou.couRemark}</p></td>
						</tr>
					</c:forEach>

				</table>
			</div>

			<div class="buyFoot">
				<div class="pageDiv">
					<c:if test="${page.page!=1 }">
						<a href="ShowQianTaiServletYu?meet=weijiesuan&couname=${couName }&page=1">首页</a>&nbsp;&nbsp;
					</c:if>
					<a href="ShowQianTaiServletYu?meet=weijiesuan&couname=${couName }&page=${page.page-1}">上一页</a>&nbsp;&nbsp;
					<a href="ShowQianTaiServletYu?meet=weijiesuan&couname=${couName }&page=${page.page+1}">下一页</a>&nbsp;&nbsp;
					<c:if test="${page.page!=page.lastPage }">
						<a href="ShowQianTaiServletYu?meet=weijiesuan&couname=${couName }&page=${page.lastPage}">尾页</a>
					</c:if>
					<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						共${page.total}条数据&nbsp;&nbsp; 当前第&nbsp;&nbsp;${page.page }&nbsp;&nbsp;页
						共&nbsp;${page.lastPage }&nbsp;页</span>
				</div>
			</div>

		</div>
		<div class="clear"></div>
		<!--清除浮动-->
	</div>
	<!--content end-->
	<div class="footer">
		<ul>
			<li class="li_left">地址：北京海淀区成府路**号</li>
			<li class="li_right">联系电话：010-82365636</li>
		</ul>
	</div>
	<!--footer end-->
	<div style="display:none">
		<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540'
			language='JavaScript' charset='gb2312'></script>
	</div>
</body>
</html>